﻿namespace Token.Utils.DotNetExtension;

/// <summary>
/// 字符串扩展方法
/// </summary>
public static class StringExtension
{
    /// <summary>
    /// 判断字符串是否为 null 或者空字符串
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public static bool IsNullOrEmpty(this string? value)
        => string.IsNullOrEmpty(value);
    
    /// <summary>
    /// 判断字符串是否为 null 或者空白字符串
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public static bool IsNullOrWhiteSpace(this string? value)
        => string.IsNullOrWhiteSpace(value);
    
    /// <summary>
    /// 判断字符串是否不为 null 或者空字符串
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public static bool IsNotNullOrEmpty(this string? value)
        => !string.IsNullOrEmpty(value);
    
    /// <summary>
    /// 判断字符串是否不为 null 或者空白字符串
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public static bool IsNotNullOrWhiteSpace(this string? value)
        => !string.IsNullOrWhiteSpace(value);
    
}